package com.comdefinition.constant

/**
 * Created by hp4664 on 2017/9/8.
 * 消息 code 常量
 */
enum CodeConstant {
    SUCCESS_CODE("0000", "操作成功"),



    //系统类异常
    ERROR_9000("9000", "系统网络异常，请稍后重试"),
    ERROR_9001("9001", "熔断"),
    ERROR_9999("9999", "未知异常")


    String code
    String desc

    CodeConstant(code, desc) {
        this.code = code
        this.desc = desc
    }

   /* static String getDescByCode(String code) {
        def all=CodeConstant.values()
        def codeList=all.code
        if(codeList.contains(code)){
            if(code == SUCCESS_CODE.code) return SUCCESS_CODE.desc
            def name="ERROR_"+code
            return  CodeConstant.valueOf(name).desc
        }else {
            return  code+" 不存在"
        }

    }*/
}